package com.itheima;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/*@SpringBootApplication
//@EnableEurekaClient  //将服务注册到eureka注册中心
@EnableDiscoveryClient //将服务注册到注册中心
@EnableCircuitBreaker  //开启熔断支持*/
@SpringCloudApplication  //一个顶三
@EnableFeignClients  //开启当前项目支持Feign
@EnableHystrixDashboard //开启熔断器的仪表盘支持
public class ConsumerServiceApplication {

	public static void main(String[] args) {
		SpringApplication.run(ConsumerServiceApplication.class, args);
	}

	@Bean
	@LoadBalanced  //开启负债均衡  ribbon
	public RestTemplate restTemplate(){
		return  new RestTemplate();
	}

}
